<%--
  Created by IntelliJ IDEA.
  User: kadsg
  Date: 2023/1/3
  Time: 13:17
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>系统后台</title>
</head>
<body>
    <jsp:include page="../head/manager.jsp"/>
    <div class="container">
        <form action="${pageContext.request.contextPath}/AddFloorController" method="get">
            <div class="form-group">
                <div class="col-sm-4">
                    <div class="input-group ms-end">
                        <input type="text" class="form-control" name="floorName">
                        <button type="submit" class="btn btn-primary">新增区域</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <c:if test="${floorDataList == null}">
        <div class="container">
            <h4>暂无数据！</h4>
        </div>
    </c:if>
    <c:if test="${floorDataList != null}">
        <section class="p-5">
            <div class="container">
                <div class="row g-4">
                    <c:forEach items="${floorDataList}" var="data" >
                        <div class="col-md">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">${data.floorName}</h5>
                                    <p class="card-text">座位数${data.totalNumber}<br>
                                        锁定${data.closedNumber}<br>
                                        占用${data.occupiedNumber}<br>
                                        空闲${data.freeNumber}
                                    </p>
                                    <a href="${pageContext.request.contextPath}/MFloorIndexController?floorName=${data.floorName}" class="btn btn-primary">查看</a>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </section>
    </c:if>
</body>
</html>
